package cn.iocoder.yudao.module.ai.dal.mysql.materialreleasefile;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.ai.dal.dataobject.materialreleasefile.MaterialReleaseFileDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.ai.controller.admin.materialreleasefile.vo.*;

/**
 * 素材解压缩文件列 Mapper
 *
 * @author 侯俊青
 */
@Mapper
public interface MaterialReleaseFileMapper extends BaseMapperX<MaterialReleaseFileDO> {

    default PageResult<MaterialReleaseFileDO> selectPage(MaterialReleaseFilePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<MaterialReleaseFileDO>()
                .eqIfPresent(MaterialReleaseFileDO::getMaterialId, reqVO.getMaterialId())
                .eqIfPresent(MaterialReleaseFileDO::getFileType, reqVO.getFileType())
                .likeIfPresent(MaterialReleaseFileDO::getFileOriginalName, reqVO.getFileOriginalName())
                .eqIfPresent(MaterialReleaseFileDO::getFileUploadPath, reqVO.getFileUploadPath())
                .eqIfPresent(MaterialReleaseFileDO::getDuration, reqVO.getDuration())
                .eqIfPresent(MaterialReleaseFileDO::getFileSize, reqVO.getFileSize())
                .betweenIfPresent(MaterialReleaseFileDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(MaterialReleaseFileDO::getSortNum, reqVO.getSortNum())
                .orderByDesc(MaterialReleaseFileDO::getId));
    }

}